﻿using UnityEngine;
using UnityEngine.UI;
using ZCUIManager;

namespace ZCMain
{
    public class MainView : UIBaseView
    {
        #region PrivateField
        private Button m_ButtonTouchDrawing;
        private Button m_ButtonAnimationEffect;
        private Button m_ButtonPostEffect;
        private Button m_ButtonMore;
        #endregion

        #region OverrideMethod
        public override void Initialize(eUIType uiType, GameObject go)
        {
            base.Initialize(uiType, go);
            m_ButtonTouchDrawing = Find(m_RectTransform, "ButtonTouchDrawing").GetComponent<Button>();
            m_ButtonAnimationEffect = Find(m_RectTransform, "ButtonAnimationEffect").GetComponent<Button>();
            m_ButtonPostEffect = Find(m_RectTransform, "ButtonPostEffect").GetComponent<Button>();
            m_ButtonMore = Find(m_RectTransform, "ButtonMore").GetComponent<Button>();
        }

        public override void InitializeListener()
        {
            base.InitializeListener();
            m_ButtonTouchDrawing.onClick.AddListener(OnClickTouchDrawing);
            m_ButtonAnimationEffect.onClick.AddListener(OnClickAnimationEffect);
            m_ButtonPostEffect.onClick.AddListener(OnClickPostEffect);
            m_ButtonMore.onClick.AddListener(OnClickMore);
        }
        #endregion

        #region ListenerMethod
        private void OnClickTouchDrawing()
        {
            MainController.Instance.SwitchView(eUIType.TouchDrawingView);
        }

        private void OnClickAnimationEffect()
        {
            MainController.Instance.SwitchView(eUIType.AnimationEffectView);
        }

        private void OnClickPostEffect()
        {
            MainController.Instance.SwitchView(eUIType.PostEffectView);
        }

        private void OnClickMore()
        {
            MainController.Instance.SwitchView(eUIType.MoreView);
        }
        #endregion
    }
}
